<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <div id="app">
        <router-link to="/list/1">跳转1</router-link>
        <router-link to="/list/2">跳转2</router-link>
        <router-link to="/list/3">跳转3</router-link>

        <router-view></router-view>
    </div>

    <template id="list">
        <div>
            <img :src=`../lib/image/0${this.$route.params.index}.jpg` alt="">
            <h3>这是第{{this.$route.params.index}}个页面</h3>
        </div>
    </template>

    <script src="../lib/Vue/vue.js"></script>
    <script src="../lib/Vue/vue-router.js"></script>
    <script>

        var routes = [
            {
                path: '/list/:index',
                component: {
                    template: '#list'
                }
            }
        ]

        const router = new VueRouter({
            routes
        })


        var vm = new Vue({
            el: '#app',
            router
        })
    </script>
</body>
</html>